import http from '../utils/http'


/**
 * 添加内容
 */
export const addTeachCourseDetail = data => http.post('/his-admin/teachcoursedetail/add', data).then(res => res.data)


/**
 * 文件上传
 * @param data
 * @returns {Promise<AxiosResponse<any>>}
 */
export const fileUpload = data => http.post('platform-user/fileUploadController/fileUpload', data).then(res => res.data)

/**
 * 根据课程id查询章ID列表
 */
export const chapterList = data => http.post('/his-admin/teachcoursedetail/chapterList', data).then(res => res.data)


/**
 * 查询课程ID列表
 */
export const courseList = data => http.post('/his-admin/teachcoursedetail/courseList', data).then(res => res.data)


/**
 * 课程列表
 */
export const getCourseList = data => http.get('/his-teachingdata/teachcourse/list', data).then(res => res.data)

/**
 * 添加课程
 * @param data
 * @returns {Promise<AxiosResponse<any>>}
 */
export const addCourse = data => http.post('/his-teachingdata/teachcourse/save', data).then(res => res.data)


/**
 * 资料分类列表
 * @param data
 * @returns {Promise<AxiosResponse<any>>}
 */
export const getDatacategoryList = data => http.get('/his-teachingdata/teachdatacategory/dataCategoryList', data).then(res => res.data)


/**
 * 获取课程详情
 * @param data
 * @returns {Promise<AxiosResponse<any>>}
 */
export const getCourseDetail = data => http.get('/his-teachingdata/teachcourse/detail', data).then(res => res.data)

/**
 * 修改课程信息
 * @param data
 * @returns {Promise<AxiosResponse<any>>}
 */
export const updateCourseDetail = data => http.post('/his-teachingdata/teachcourse/update', data).then(res => res.data)


/**
 * 课程内容列表
 * @param data
 * @returns {Promise<AxiosResponse<any>>}
 */
export const courseContentList = data => http.post('/his-admin/teachcoursedetail/courseContentList', data).then(res => res.data)

/**
 * 课程内容详情
 * @param data
 * @returns {Promise<AxiosResponse<any>>}
 */
export const courseContentDetail = data => http.get('/his-teachingdata/teachcoursedetail/courseDetail', data).then(res => res.data)

/**
 * 编辑课程内容
 * @param data
 * @returns {Promise<AxiosResponse<any>>}
 */
export const updateCourseContent = data => http.post('/his-admin/teachcoursedetail/updateCourseContent', data).then(res => res.data)

/**
 * 登录
 * @param data
 * @returns {Promise<AxiosResponse<any>>}
 */
export const login = data => http.post('/platform-user/login', data).then(res => res.data)

